<template>
  <ms-dnyc-table
    row-key="configId"
    :table-props="tableProps"
    :data-source="tablesData"
    add-row
    tools
    @removeRow="(confId) => tableRemoveIds.push(confId)"
  />
</template>

<script>
import { MsDnycTable } from '@/common/table'

export default {
  components: {
    MsDnycTable
  },
  data() {
    return {
      tableProps: [
        { index: 'name', label: '附件名称', type: 'input' },
        { index: 'processId', label: '表单标识', type: 'input' },
        { index: 'filePath', label: '存储路径', type: 'input' },
        {
          index: 'isMultiple', label: '多选', type: 'checkbox', minWidth: true
        },
        {
          index: 'listType',
          label: '附件格式',
          type: 'selects',
          config: {
            lists: [
              {
                id: 'text',
                value: '普通格式'
              }, {
                id: 'picture-card',
                value: '图片卡片'
              }, {
                id: 'picture',
                value: '图片缩略图'
              }
            ]
          }
        },
        { index: 'limits', label: '最大数量', type: 'input' }
      ],
      tablesData: [],
      tableRemoveIds: []
    }
  }
}
</script>
